/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.toools.gwt.wmc.client.waste.gui;

import org.toools.gwt.widget.client.bc.BasicControl;
import org.toools.gwt.widget.client.bc.BasicList;
import org.toools.gwt.widget.client.cloud.TagRenderer;
import org.toools.gwt.widget.client.cloud.TagVO;
import org.toools.gwt.wmc.jpa.Waste;

/**
 *
 * @author Manuel
 */
public class WasteList extends BasicList{

    public WasteList(TagVO[] data, BasicControl bc) {
		super(data, bc);
	}

    @Override
	public TagRenderer createTagRenderer(TagVO tag) {
		return new WasteListRenderer(tag, getBasicControl());
	}

	public boolean filter(TagVO tag) {
		Waste w = (Waste) tag.getAttachedBusinessObject();
		if(w.getWasteDesc().toLowerCase().contains(getFilter().toLowerCase())) {
			return true;
		}
		else {return false;}
	}
}
